package com.zh.myrule;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @Description:
 * @ClassName MySelfRule
 * @date: 2021.06.17 11:30
 * @Author: zhanghang
 */
@Configuration
public class MySelfRule {

	@Bean
	public IRule getRule(){
		AtomicInteger atomicInteger = new AtomicInteger(1);
		atomicInteger.compareAndSet(1,2);
		// 随机算法
		return new RandomRule();
	}
}
